<template>
  <div class="layout" >
    <Header />
    <Nav @updateNewproduct="updateNewproduct"/>
    <Main :new_list="new_list"/>
    <Footer />
  </div>
</template>

<script>
  import Header from './Header.vue';
  import Nav from './Nav.vue';
  import Main from './Main.vue';
  import Footer from './Footer.vue';

  export default {
    name: 'Layout',
    components: { Header, Nav, Main, Footer },
    data() {
      return {
        new_list: []
      };
    },
    methods: {
      updateNewproduct(list) {
        this.new_list = list.data.list;
      }
    },
    /*
    watch: {
      new_list: {
        immediate: true,
        deep: true,
        handler(to) {
          console.log('new list : ' + JSON.stringify(to));
        }
      }
    },*/
    created() {}
  };
</script>

<style lang="scss" type="text/scss" scoped>
.layout {
  background: #f9f9f9;
}
</style>
